<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateActivityShopRel extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_shop_rel', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("activityId")->comment("activity.id")->comment(0);
            $table->unsignedBigInteger("shopId")->comment("门店ID")->comment(0);

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1是');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '活动 - 可参与门店关联配置表';

            $table->index(["activityId", "shopId"], "idx_activityId_shopId");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_shop_rel');
    }
}
